
CC  = arm-hisi-linux-gcc 

LINK_FLAGS = -g

bin = armds1338
OBJS := ds1338.o encode.o


read_bin = readtime
r_OBJ = readtime.o

write_bin = writetime
w_OBJ = writetime.o


.PHONY : clean


all:$(bin) $(read_bin) $(write_bin)

$(bin):$(OBJS)
	$(CC) -o $(bin) $(OBJS) 

$(OBJS) : %.o : %.c
	$(CC) -c  $< -o $@



$(read_bin):$(r_OBJ)
	$(CC) -o $(read_bin) $(r_OBJ) 

$(r_OBJ) :

#$(r_OBJ) : readtime.o : readtime.c
#	$(CC) -c  $< -o $@

$(write_bin):$(w_OBJ)
	$(CC) -o $(write_bin) $(w_OBJ) 
$(w_OBJ):


clean:
	rm -rf *.o
	rm -rf $(bin)

